import React from 'react'



export default class Child extends React.Component{
    
    constructor(props){
        super(props);
        this.state = {
            count:0
        };
    }

    componentWillUnmount(){
        console.log('will');

    }

    componentDidMount(){
        console.log('did')

    }


    // 接收从其他组件里面传入的参数
    componentWillReceiveProps(newProps){
        console.log('willRe');

    }

    shouldComponentUpdate(){
        console.log('Component');

        return true;

    }

    componentWillUpdate(){
        console.log('willupdate');

    }

    componentDidUpdate(){
        console.log('didupdate');

    }
   
    
    render(){
        var style = {
            padding:100
        }

        return <div style={style}>
          <p>{this.props.name}</p>
        </div>

    }

}